﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReplaceWebpartInstance.aspx.cs" Inherits="SharePoint_Replace_WebParts.Layouts.SharePoint_Replace_WebParts.ReplaceWebpartInstance" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">

</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <table style="width:100%;">
            <tr align="left" valign="top">
                <td  colspan="3">
                    <table style="width:100%;">
                        <tr>
                            <td >
                                <asp:Label ID="Label1" runat="server" Text="Site Url"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtsiteurl" runat="server" style="margin-left: 0px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td >
                                <asp:Label ID="Label2" runat="server" Text="WebPart Name"></asp:Label>
                            </td>
                            <td>
                                <asp:TextBox ID="txtwpname" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td >
                                <asp:Button ID="btnexecuteWebPages" runat="server" 
                                    onclick="WebPagesClick" Text="FindWebpages" Width="202px" />
                            </td>
                            <td>
                                <asp:Button ID="btnexecuteWebparts" runat="server" 
                                    onclick="BtnexecuteWebpartsClick" Text="FindWebPartExistance" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr align="left" valign="top">
                <td >
                    <asp:ListBox ID="lstLinks" runat="server" 
                        OnSelectedIndexChanged="LsLinksSelectionChanged" AutoPostBack="true" 
                        Height="269px" Width="533px"></asp:ListBox>
                </td>
                <td colspan="2">
                    <asp:Panel ID="pnlcontentarea" runat="server" Height="264px" 
                        style="margin-left: 0px">
                    </asp:Panel></td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="Label3" runat="server" Text="Search"></asp:Label>
                    <asp:TextBox ID="txttofind" runat="server"></asp:TextBox>
                    <asp:RadioButtonList ID="rdolstScope" runat="server">
                        <asp:ListItem Selected="True">Page</asp:ListItem>
                        <asp:ListItem>Web</asp:ListItem>
                        <asp:ListItem>Site</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:Label ID="Label4" runat="server" Text="Replace"></asp:Label>
                    <asp:TextBox ID="txttoreplacewith" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr><asp:Panel ID="PanelReplaceRegion"  runat=server>
                <td colspan="2">
                    <asp:Label ID="Label5" runat="server" Text="Remove"></asp:Label>
                    <asp:TextBox ID="txtremove" runat="server"></asp:TextBox>
                    <asp:Button ID="btnreplace" runat="server" onclick="BtnreplaceClick" 
                        Text="Replace" />
                    <asp:Button ID="btnreplace0" runat="server" onclick="BtnremoveClick" 
                        Text="Remove" />
                </td></asp:Panel>
            </tr>
            <tr>
                <td colspan="2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3" >
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Label ID="lblerror" runat="server" ForeColor="Red"></asp:Label>
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
    <ContentTemplate>
        <table style="width:37%;"   align="left">
            <tr>
                <td >    
                    <asp:Label ID="Label6" runat="server" Text="Assembly Name"></asp:Label>
                </td>
                <td >
                    <asp:TextBox ID="txtAssemblyName" runat="server" Width="636px"></asp:TextBox>
                </td>
                <td >
                    <asp:Button ID="btnClear" runat="server" onclick="BtnClearClick" 
                                    Text="Clear" />
                </td>
            </tr>
            <tr>
                <td >
                    <asp:Label ID="Label7" runat="server" Text="Type Name"></asp:Label>
                </td>
                <td >
                    <asp:TextBox ID="TxtTypeName" runat="server" Width="633px"></asp:TextBox>
                </td>
                <td >
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnGenerateId" runat="server" onclick="BtnGenerateIdClick" 
                                    Text="Generate" />
                </td>
                <td>
                    <asp:TextBox ID="TxtWebpartId" runat="server" ReadOnly="True" Width="632px"></asp:TextBox>
                </td>
                <td>
                    <input type="button" id='btnCopy' onclick="clipboardData.setData('Text',document.getElementById('ctl00_m_g_afeffce1_3877_4f2a_bc5d_aee06bff850b_ctl00_TxtWebpartId').value);"  value="Copy" />
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpdatePanel3" runat="server">
    <ContentTemplate>
        <table style="width:100%;">
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    <asp:Button ID="btnGetDatabases" runat="server" Text="GetDataBases"  onclick="BtnGetDatabasesClick" />
                    <asp:Button ID="btnSqlQueryExecute" runat="server" 
                        onclick="BtnSqlQueryExecuteClick" Text="ExecuteVerifyQuery" />
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:CheckBoxList ID="chkdbs" runat="server">
                    </asp:CheckBoxList>
                </td>
              
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="gv_ResultQuery" runat="server">
                    </asp:GridView>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
           
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
    <ContentTemplate>
        <table style="width:37%;"   align="left">
            <tr>
                <td >    
                    <asp:Label ID="lblrpassemblyname" runat="server" Text="Assembly Name"></asp:Label>
                </td>
                <td >
                    <asp:TextBox ID="txtrpassemblyname" runat="server" Width="636px"></asp:TextBox>
                </td>
                <td >
                    <asp:Button ID="btnrpclear" runat="server" onclick="BtnRpClearClick" Text="Clear" />
                </td>
            </tr>
            <tr>
                <td >
                    <asp:Label ID="lblrptypename" runat="server" Text="Type Name"></asp:Label>
                </td>
                <td >
                    <asp:TextBox ID="txtrptypename" runat="server" Width="633px"></asp:TextBox>
                </td>
                <td >
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnrpgenerate" runat="server" onclick="BtnRpGenerateIdClick"  Text="Generate" />
                </td>
                <td>
                    <asp:TextBox ID="txtrpgeneratedwpinstance" runat="server" ReadOnly="True" Width="632px"></asp:TextBox>
                </td>
                <td>
                    <input type="button" id='Button3' onclick="clipboardData.setData('Text',document.getElementById('ctl00_m_g_afeffce1_3877_4f2a_bc5d_aee06bff850b_ctl00_TxtWebpartId').value);"  value="Copy" />
                </td>
            </tr>
             <tr>
                <td>
                     <asp:Button ID="btnexecuteQuery" runat="server" onclick="BtnExecuteQueryClick"  Text="Execute Replace" /></td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Replace WebPart Instances Application Page
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
Replace WebPart Instances Application Page
</asp:Content>
